package com.wangyadong.hobby.schedule.jobtask.thread;

import com.wangyadong.hobby.schedule.jobtask.string.StringTest;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/7/2312:29
 **/
public class volatileTest3 {
    public static StringTest stringTest;

    public static void main(String[] args) {

        new Thread(() -> {
            stringTest = new StringTest();
            System.out.println(Thread.currentThread().getName() + " memory location is " + stringTest);

        }).start();
        try {
            Thread.sleep(10001);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        new Thread(() -> {
            System.out.println(Thread.currentThread().getName() + "  memory location is" + stringTest);

        }).start();

    }
}
